package com.tjc.apiinterface.controller;

import com.tjc.apiclientsdk.model.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName NameController
 * @Author tjc
 * 这里直接提供接口方法就可以了，鉴权交给网关就可以了
 **/
@RestController
public class NameController {

    @PostMapping("/name/user")
    public String getNameByRestful(@RequestBody User user) {
        return user.getName();
    }

    @GetMapping("/name")
    public String getName(){
        return "name";
    }
}
